package com.cms.common.hook.config;

public enum FiledTypeEnum {

    TEXT("输入框", 1),
    FILE("文件上传", 2),
    RADIO("单选框", 3),
    SWITCH("开关", 4),
    NUMBER("数字输入框", 5),
    TEXTAREA("文本域", 6),
    SPAN("显示文本", 7),
    SELECT("下拉框", 8);
    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private FiledTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (FiledTypeEnum c : FiledTypeEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
